<script setup lang="ts">
import { onMounted } from 'vue'
import { useCartStore } from '@/stores/cart'
import { RouterLink } from 'vue-router'

const cart = useCartStore()

onMounted(() => {
  cart.clear()
})
</script>

<template>
  <div class="container center">
    <h2>下单成功</h2>
    <p>感谢您的购买，我们将尽快处理订单。</p>
    <RouterLink to="/">返回首页</RouterLink>
  </div>
</template>

<style scoped>
.center { text-align: center; padding: 40px 0; }
.center a { display: inline-block; margin-top: 12px; color: #42b883; }
</style>